<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="/common/meta.jsp"%>
<link href="<s:url value='/css/main.css'/>" rel="stylesheet" type="text/css"/>
<script type="text/javascript" language="JavaScript"  src="<s:url value='/js/jquery/jquery-1.3.2.min.js'/>"></script>
<script language="Javascript" src="js/md5.js"></script>
<script type="text/javascript" src="<s:url value='/js/DatePicker/DatePicker.js'/>"></script>
<script type="text/javascript">
	$(function(){
		
	})
	
	function setValues(){
		$("#uname").attr("value", $("#username").attr("value"));
		$("#upw").attr("value", hex_md5($("#pwd").attr("value")));
		$("#pwd").attr("value", "");
	}
</script>
<title>南航信息中心青年资源库</title>
</head>

<body>
<script language="JavaScript">
    function putThisPageTopLevel() {
        if (window.opener != null) {
            // This is a popup window
            window.opener.top.location = self.location;
            window.close();
        } else {
            if (top.location != self.location) {
                top.location = self.location;
            }
        }
    }
    putThisPageTopLevel();
</script>
	<s:if test="%{message != null}">
		<font color='red'><s:property value="message" /></font>
	</s:if>
	<div class="login_div"></div>
    <div id="login_form" class="login_div2">
    	<s:form action="Login" method="post" namespace="/">
    		<!-- 看起来S2是根据name属性来匹配，利用隐藏表单域来实现密码加密并提交给action -->
    		<s:hidden name="user.loginName" id="uname" value=""></s:hidden>
    		<s:hidden name="user.password" id="upw" value=""></s:hidden>
        	<span>用户名： <s:textfield name="username" value="%{user.loginName}" id="username"></s:textfield></span>&nbsp;&nbsp;
            <span>密&nbsp;&nbsp;&nbsp;码： <s:password name="pwd" value="" id="pwd"></s:password></span>&nbsp;&nbsp;
            <span><s:submit id="submit" value=" 登 陆 " method="doLogin" cssClass="button" onclick="setValues();" /></span>
        </s:form>
    </div>
</body>
</html>
